#include"mk.h"
#include"hgmcu.h"
/*uchar code table[]={
0xC0,0xF9,0xA4,0xB0,
0x99,0x92,0x82,0xF8,
0x80,0x90,0x88,0x83,
0xC6,0xA1,0x86,0x8E,0xff};*/
void delay(uint z)
{
	uint x,y;
	for(x=z;x>0;x--)
		for(y=110;y>0;y--);
}
void display(uchar qian,uchar bai,uchar shi,uchar ge,uchar cyc,uchar time)
{
uchar xh;
for(xh=0;xh<cyc;xh++)
		{
			//qbsg
			P0=qian;
			P20=0;
			delay(time);
			P20=1;
			P0=bai;
			P21=0;
			delay(time);
			P21=1;
			P0=shi;
			P22=0;
			delay(time);
			P22=1;
			P0=ge;
			P23=0;
			delay(time);
			P23=1;
		}
}
void xszfc(uchar tzfc[4],uint sz_t)
{
	uchar code smgascii[]={
	0xFF,0x79,0xDD,0x81,0x9A,0x9C,0x84,0xFD,//0x20-0x27 32-39
	0xC6,0xF0,0xBC,0xB9,0xFB,0xBF,0x7F,0xAD,//0x28-0x2F 40-47
	0x89,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,//0x30-0x37 48-55
	0x80,0x90,0x7D,0x77,0x9E,0xBE,0xBC,0x38,//0x38-0x3F 56-63
	0x22,0x88,0x83,0xA7,0xA1,0x86,0x8E,0xC2,//0x40-0x47 64-71
	0x89,0xF0,0xF1,0x8A,0xC7,0xAA,0xAB,0xA3,//0x48-0x4F 72-79
	0x8C,0x98,0xAF,0xD2,0xCE,0xC1,0xE3,0xE2,//0x50-0x57 80-87
	0xC9,0x8D,0xE4,0xC6,0x9B,0xF0,0xDC,0xF7};//0x58-0x5F
	uchar sa_for,ascii,sat_out,smgzmt,qian,bai,shi,ge;
	for(sa_for=0;sa_for<4;sa_for++)
	{
		ascii=tzfc[sa_for];
		if(ascii>0x60)
			{sat_out=ascii-0x40;}
		else
			{sat_out=ascii-0x20;}
		smgzmt=smgascii[sat_out];
		if(ascii==0x7c)
			{smgzmt=0xf9;}
		switch(sa_for)
		{
			case 0:
			{qian=smgzmt;break;}
			case 1:
			{bai=smgzmt;break;}
			case 2:
			{shi=smgzmt;break;}
			case 3:
			{ge=smgzmt;break;}
		}
	}
	display(qian,bai,shi,ge,sz_t,1);
}